package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.TbPower;
import com.ruoyi.system.mapper.TbPowerMapper;
import com.ruoyi.system.service.ITbPowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 权限Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-23
 */
@Service
public class TbPowerServiceImpl implements ITbPowerService 
{
    @Autowired
    private TbPowerMapper tbPowerMapper;

    /**
     * 查询权限
     * 
     * @param powerId 权限主键
     * @return 权限
     */
    @Override
    public TbPower selectTbPowerByPowerId(Long powerId)
    {
        return tbPowerMapper.selectTbPowerByPowerId(powerId);
    }

    /**
     * 查询权限列表
     * 
     * @param tbPower 权限
     * @return 权限
     */
    @Override
    public List<TbPower> selectTbPowerList(TbPower tbPower)
    {
        return tbPowerMapper.selectTbPowerList(tbPower);
    }

    /**
     * 新增权限
     * 
     * @param tbPower 权限
     * @return 结果
     */
    @Override
    public int insertTbPower(TbPower tbPower)
    {
        return tbPowerMapper.insertTbPower(tbPower);
    }

    /**
     * 修改权限
     * 
     * @param tbPower 权限
     * @return 结果
     */
    @Override
    public int updateTbPower(TbPower tbPower)
    {
        return tbPowerMapper.updateTbPower(tbPower);
    }

    /**
     * 批量删除权限
     * 
     * @param powerIds 需要删除的权限主键
     * @return 结果
     */
    @Override
    public int deleteTbPowerByPowerIds(Long[] powerIds)
    {
        return tbPowerMapper.deleteTbPowerByPowerIds(powerIds);
    }

    /**
     * 删除权限信息
     * 
     * @param powerId 权限主键
     * @return 结果
     */
    @Override
    public int deleteTbPowerByPowerId(Long powerId)
    {
        return tbPowerMapper.deleteTbPowerByPowerId(powerId);
    }
}
